<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <meta http-equiv="X-UA-Compatible" content="IE=edge" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>Document</title>
  </head>
  <body>
    <script>
      //  实现一个函数makeAdder，接受一个数字作为参数，
      //  返回一个新的函数，
      //  该函数可以将传入的参数与makeAdder函数的参数进行相加并返回结果

      //实现以下效果
      // const addFive = makeAdder(5);
      // console.log(addFive(10)); // 15
      // console.log(addFive(20)); // 25

      const makeAdder = (b) => {
        let a = 5
        const fn = (a) => {
          return a + b
        }
        return fn
      }
      const addFive = makeAdder(5)
      console.log(addFive(10)) // 15
      console.log(addFive(20)) // 25
    </script>
  </body>
</html>
